Core Java - Interview Questions and Answers for 'Core Java' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Interview Questions and Answers - Order By Rating

   next 30
 Q31. Can we assign the reference to this variable ?Core Java
Ans. No

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q32. Hash map using/without using Java 8Core Java
 This question was recently asked at 'HCL Technologies'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q33. What is Throwable ?Core Java
Ans. Throwable in java is a class that is the superclass of all exceptions and errors which may occurs in java program.It extends obcect class.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     exception handling   throwable     Asked in 1 Companies      basic


 Q34. What is string pool and what is the use of intern() function ?Core Java
Ans. The Java String class intern() method returns the interned string. It returns the canonical representation of string.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q35. How to make a collection thread safe?Core Java
 This question was recently asked at 'Amodcs'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q36. What is a comparator ?Core Java
Ans. Java Comparator compares two Java objects in a “compare(Object 01, Object 02)” format. Using configurable methods, Java Comparator can compare objects to return an integer based on a positive, equal or negative comparison

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q37. Why should we go for custom defined exceptions even if we have many exceptions provided already using throw keywordCore Java
Ans. It gives us the liberty to throw the specific exceptions which are required and also we can control the handling of exceptions

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q38. How does Garbage Collector work? What are the realizations of Garbage Collector.Core Java
 This question was recently asked at 'ExpertSoft'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q39. How multiple catch block works ?Core Java
 This question was recently asked at 'Capgemini'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q40. What is the use of toString method ?Core Java
 This question was recently asked at 'Jibe Technology Services'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q41. Class and Object methods.Core Java
Ans. class:- A class describe the contents of an object, an it describe the detail of data field called instance variable and defines the operations called method.

Object:-An object is an element of a class. Object have the behaviors of their class.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q42. How to get collections from a StreamCore Java
 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     Java 8


 Q43. Can anonymous class implement interface and extend a classCore Java
 This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q44. What is ServerSocket in Java ?Core Java
Ans. This class implements server sockets. A server socket waits for requests to come in over the network. It performs some operation based on that request, and then possibly returns a result to the requester.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q45. What are the distinguished qualities in Java that no other language possess ? Core Java
Ans. Java is widely adopted as an enterprise standard technology across business domains and technical domains ( Web , Desktop , mobile , data science etc ) and has a vast ecosystem of frameworks and libraries.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     


 Q46. What is headless mode in Java ? Why is it used ?Core Java
Ans. It’s a mode that can be used for creating Back end application without the front end UI.

The advantage is that it reduces the number of packages that needs to be loaded ( by ignoring ui packages )

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java headless


 Q47. Write a code to detect the longest palindromic substring Core Java
 This question was recently asked at 'Google'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q48. What are the pros and cons of Lambda expressions ?Core Java
 This question was recently asked at 'Number 8'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q49. Write a program to rotate a matrix.Core Java
Ans. public class Matrix {

   public static void main(String[] args) {
      int[][] matrix = {
            {1, 2, 3},
            {4, 5, 6},
            {7, 8, 9}
      };
      Matrix.rotateMatrix(matrix);
      for (int i = 0; i < matrix.length; i ){
         for (int j = 0; j < matrix.length; j ){
            System.out.print(matrix[i][j] " ");
         }
         System.out.println();
      }
   }

   public static void rotateMatrix(int[][] matrix){
      int row = matrix.length;
      //first find the transpose of the matrix.
      for (int i = 0; i < row; i ){
         for (int j = i; j < row; j ){
            int temp = matrix[i][j];
            matrix[i][j] = matrix[j][i];
            matrix[j][i] = temp;
         }
      }
      //reverse each row
      for (int i = 0; i< row; i ){
         for(int j = 0; j< row/2; j ){
            int temp = matrix[i][j];
            matrix[i][j] = matrix[i][row - 1 - j];
            matrix[i][row - 1 - j] = temp;
         }
      }

   }

}

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q50. How does hashmap works ?Core Java
 This question was recently asked at 'Fujitsu'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q51. How do you achieve String immutability ?Core Java
 This question was recently asked at 'Polaris'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q52. Can we override behavior of a collection class ? How ?Core Java
Ans. Yes. We can do that.

1. We can create own own implementation class extending the collection class and then override the behavior method.

2. We can override the behavior at the time of instantiation of class as following

List<MyType> list = new ArrayList<MyType>() {
public boolean add(MyType mt) {
super.add(mt);
Collections.sort(list, comparator);
return true;
}
};

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     collections


 Q53. What is the difference between map and filter methods in streams ?Core Java
Ans. By using map , you can transform the object values. The map operation allows us to apply a function, that takes input parameter of one type, and returns something else.

Filter is used for filtering the data, it always returns the boolean value. If it returns true, then item is added to list else its filtered out (ignored)

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java 8     Asked in 1 Companies


 Q54. How abstraction worksCore Java
 This question was recently asked at '360Degree'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q55. Explain how a class is loaded ?Core Java
Ans. Java classLoder is resposible to load java classes.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q56. What if we use all access specifiers ? Is it encapsulation ?Core Java
 This question was recently asked at '3 Embeded Software Technologies'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q57. Difference between class and object with example.Core Java
 This question was recently asked at 'TalenPace'.This question is still unanswered. Can you please provide an answer.


 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q58. Is there a way to access a private method from an outside class ?Core Java
Ans. Through Reflection.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q59. What are the different types of inheritance ?Core Java
Ans. Single Level
Multi Level
Hierarchical
Multiple
Hybrid

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


 Q60. Why in Java does it require "static" in the main function?Core Java
Ans. Because there needs to be a starting point till when there is no object created in memory and hence it needs to be run in static scope

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve          Asked in 1 Companies


previous 30   next 30

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: